#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int array[30][5] = { 0 };
int main()
{
	int n, sum = 0;
	int au;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d%d", &array[i][1], &array[i][2]);
		array[i][3] = 100 / array[i][1];
		array[i][4] = array[i][3] * array[i][2];
		sum += array[i][4];
	}
	scanf("%d", &au);
	if (sum >= au) { printf("Already Au."); return 0; }
	au -= sum;
	for (int i = 1; i <= n; i++) {
		if ((array[i][1] - array[i][2]) * array[i][3] >= au) {
			int j = 1;
			for(; j * array[i][3] < au; j++);
			printf("%d\n", j);
		}
		else printf("NaN\n");
	}
	return 0;
}